<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>打印</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            font-size: 14px;
            background-color: #f1f3f4;
        }

        .table-con {
            margin: 10px 20px 10px 10px;
        }

        .table {
            width: 100%;
            text-align: center;
            background-color: #fff;
        }

        .title {
            font-size: 18px;
            font-weight: bold;
            padding: 8px;
        }

        .tr {
            height: 40px;
        }

        .th {
            background-color: #E1E4E6;
        }
    </style>
</head>

<script type="text/javascript">
function scanprint(){
    var datalistdiv = document.getElementById("home");
    window.connect.print(datalistdiv.offsetLeft, datalistdiv.offsetTop, datalistdiv.offsetWidth, datalistdiv.offsetHeight);
}
function feed(){
	window.connect.doFeed();
}
function getDetail(detail){
    var jsonData = JSON.parse(detail);
	// 设置出库单号
    document.getElementById('ckCode').innerText = jsonData.ckCode;
    // 列表显示
    var loveArr = jsonData.dataList;
    let html = '';
	for (let i in loveArr) {
		html= html + "<tr class='tr'>";
		html= html + "<td>" + loveArr[i].code + "</td>";
		html= html + "<td>" + loveArr[i].wasteClassifyName + "</td>";
		html= html + "<td>" + loveArr[i].weight + ' kg' + "</td>";
		html= html + "</tr>";
	}
	document.getElementsByClassName('tb')[0].innerHTML = html;
}
</script>

<body>
	<div class="table-con" id="home">
		<div style="text-align:right; margin-bottom:5px; margin-right:20px">出库单号：<span id="ckCode"></span></div>
		<table class="table" width="100%" border cellpadding="0" cellspacing="0" bordercolor="#ebebeb">
			<thead>
				<tr class="tr th" width="100%">
					<th min-width="60%" width="60%">医废编号</th>
					<th min-width="20%" width="20%">分类</th>
					<th min-width="20%" width="20%">重量</th>
				</tr>
			</thead>
			<tbody class="tb">
			</tbody>
		</table>
	</div>
</body>
</html>